//
//  Black.cpp
//  dentist
//
//  Created by Denveryee on 13-12-3.
//
//

#include "Black.h"
#include "BaseBadPoint.h"
#include "BaseTooth.h"
#include "cocos2d.h"

Black::Black(void)
{
}

Black::~Black(void)
{
	badPoint->autorelease();
}

Black::Black(BaseTooth::Position toothKind){
	kind = BLACK;
	op = 255;
	scheFlag = true;
    empty = false;
    finishFixed = false;
	switch(toothKind){
		case BaseTooth::UP_LEFT_ONE:
			badPoint = CCSprite::create("img_sr_1280_720_damage_dark_t30003_png.png");
			badPoint->setPosition(ccp(98,217));
			addChild(badPoint);
			break;
		case BaseTooth::UP_LEFT_TWO:
            badPoint = CCSprite::create("img_sr_1280_720_damage_dark_t20002_png.png");
			badPoint->setPosition(ccp(122,217));
			addChild(badPoint);
            break;
		case BaseTooth::UP_LEFT_THREE:
			badPoint = CCSprite::create("img_sr_1280_720_damage_dark_t10002_png.png");
			badPoint->setPosition(ccp(149,217));
			addChild(badPoint);
			break;
		case BaseTooth::UP_LEFT_FOUR:
            badPoint = CCSprite::create("img_sr_1280_720_damage_dark_t10002_png.png");
			badPoint->setPosition(ccp(179,217));
            badPoint->setFlipX(true);
			addChild(badPoint);
            break;
		case BaseTooth::UP_LEFT_FIVE:
            badPoint = CCSprite::create("img_sr_1280_720_damage_dark_t20002_png.png");
			badPoint->setPosition(ccp(206,217));
            badPoint->setFlipX(true);
			addChild(badPoint);
            break;
		case BaseTooth::UP_LEFT_SIX:
            badPoint = CCSprite::create("img_sr_1280_720_damage_dark_t30003_png.png");
			badPoint->setPosition(ccp(230,217));
            badPoint->setFlipX(true);
			addChild(badPoint);
            break;
		case BaseTooth::DOWN_LEFT_ONE:
            badPoint = CCSprite::create("img_sr_1280_720_damage_dark_t3_10002_png.png");
			badPoint->setPosition(ccp(98,179));
			addChild(badPoint);
            break;
		case BaseTooth::DOWN_LEFT_TWO:
            badPoint = CCSprite::create("img_sr_1280_720_damage_dark_t2_10002_png.png");
			badPoint->setPosition(ccp(123,174));
			addChild(badPoint);
            break;
		case BaseTooth::DOWN_LEFT_THREE:
            badPoint = CCSprite::create("img_sr_1280_720_damage_dark_t1_10002_png.png");
			badPoint->setPosition(ccp(150,170));
			addChild(badPoint);
            break;
		case BaseTooth::DOWN_LEFT_FOUR:
            badPoint = CCSprite::create("img_sr_1280_720_damage_dark_t1_10002_png.png");
			badPoint->setPosition(ccp(178,170));
            badPoint->setFlipX(true);
			addChild(badPoint);
            break;
		case BaseTooth::DOWN_LEFT_FIVE:
            badPoint = CCSprite::create("img_sr_1280_720_damage_dark_t2_10002_png.png");
			badPoint->setPosition(ccp(205,173));
            badPoint->setFlipX(true);
			addChild(badPoint);
            break;
		case BaseTooth::DOWN_LEFT_SIX:
            badPoint = CCSprite::create("img_sr_1280_720_damage_dark_t3_10002_png.png");
			badPoint->setPosition(ccp(230,179));
            badPoint->setFlipX(true);
			addChild(badPoint);
            break;
	}
}

bool Black::fixBadTooth(){
    badPoint->setOpacity(100);
    
	return true;
}

void Black::remove(float dt){
    if(scheFlag){
        this->removeChild(badPoint);
        kind = EMPTY;
        empty = true;
        scheFlag = false;
    }
}

void Black::stopFix(){
    if(scheFlag){
        badPoint->setOpacity(255);
    }
}
